<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<style>
    #demo{
        width: 80px;
        margin-left: 0;
        margin-right: 0;
    }
    #demo1{
        width: 80px;
        margin-left: 0;
        margin-right: 0;
    }
    .form_label{
        margin-left: -150px;
        margin-right: 0px;
    }
</style>

<head>
    <meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
    <title>客房情况</title>
    <link href="/xiaozu/css/main.css" rel="stylesheet" type="text/css">
    <link href="/xiaozu/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/xiaozu/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">

</head>
<body>
<div class="tabe_div">
    <form action="<%=request.getContextPath()%>/hotel/tradingSearch" method="post">
    <p class="p_line text_ient"><a class="find_a">酒店名称：</a><input type="text" value="${roomname}" name="roomname" class="form_input text_ient" placeholder="输入关键字或全称"/>
        <a  class="find_a">酒店星级：</a>
        <select class="form_select" style="padding-left: 1%;" id="roomstar" name="roomstar">
            <option value="0" <c:if test="${roomstar == 0}">selected="selected"</c:if>>全部</option>
            <option value="1" <c:if test="${roomstar == 1}">selected="selected"</c:if>>1星</option>
            <option value="2" <c:if test="${roomstar == 2}">selected="selected"</c:if>>2星</option>
            <option value="3" <c:if test="${roomstar == 3}">selected="selected"</c:if>>3星</option>
            <option value="4" <c:if test="${roomstar == 4}">selected="selected"</c:if>>4星</option>
            <option value="5" <c:if test="${roomstar == 5}">selected="selected"</c:if>>5星</option>
        </select>
        <a class="find_a">时间：</a><label class="form_label"></label><input value="${pastTime}" name="pastTime" class="form_date" id="demo"/>—<label class="form_label"></label><input value="${futureTime}" name="futureTime" class="form_date" id="demo1"/>
        <input type="submit" value="查询" class="but_find"/><p>
    <p class="p_table">
    </form>
        <a href="#" class="a_add">全部导出</a>
    </p>


    <table id="table" class="table_style" style="margin: 0 auto" >
        <c:forEach var="transaction" items="${transactionList}">
            <tr>
                <td>${transaction.ho_transaction_id}</td>
                <td>${transaction.ho_transaction_name}</td>
                <td>${transaction.ho_transaction_star}</td>
                <td><fmt:formatDate value="${transaction.ho_transaction_tome}" pattern="yyyy-MM-dd"/></td>
                <td>${transaction.ho_transaction_payment}</td>
                <td>${transaction.ho_transaction_days}</td>
                <td>${transaction.ho_transaction_roomnum}</td>
                <td>${transaction.ho_transaction_turnover}</td>
                <td>${transaction.ho_transaction_phone}</td>
                <td>${transaction.ho_transaction_remarks}</td>
            </tr>
        </c:forEach>
    </table>





</div>
<div></div>
<script src="/xiaozu/js/jquery.js"></script>
<script src="/xiaozu/js/date/js/laydate.js"></script>
<script src="/xiaozu/bstable/js/bootstrap.min.js"></script>
<script src="/xiaozu/bstable/js/bootstrap-table.js"></script>
<script src="/xiaozu/bstable/js/bootstrap-table-zh-CN.min.js"></script>
<script>
    !function () {
        laydate.skin('danlan'); //切换皮肤，请查看skins下面皮肤库
        laydate({ elem: '#demo' });
        laydate({ elem: '#demo1' }); //绑定元素
    } ();
</script>

<script type="text/javascript">
    $(function () {
        $('#table')
            .bootstrapTable({
                method: "get",
                striped: true,
                singleSelect: false,
                url: "/xiaozu/json/tradingSearch.json",
                dataType: "json",
                pagination: true, //分页
                pageSize: 10,
                pageNumber: 1,
                search: false, //显示搜索框
                contentType: "application/x-www-form-urlencoded",
                queryParams: null,
                columns: [
                    {
                        title: "序号",
                        field: 'id',
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        title: '酒店名称',
                        field: 'name',
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        title: '星级',
                        field: 'star',
                        align: 'center'
                    },
                    {
                        title: '交易时间',
                        field: 'tradingTime',
                        align: 'center'
                    },
                    {
                        title: '付款方式',
                        field: 'payment',
                        align: 'center'
                    },
                    {
                        title: '入住天数',
                        field: 'days',
                        align: 'center'
                    },
                    {
                        title: '房间号',
                        field: 'roomID',
                        align: 'center'
                    },
                    {
                        title: '交易额（元）',
                        field: 'much',
                        align: 'center'
                    },
                    {
                        title: '联系电话（酒店）',
                        field: 'phone',
                        align: 'center'
                    },
                    {
                        title: '交易备注',
                        field: 'note',
                        align: 'center'
                    }
                ]
            });
    });

    function addHotel() {
        this.location.href = "addHotel.html";
    }

    function editHotel(id) {
        this.location.href = "editHotel.html";
    }

</script>
<script src="/xiaozu/layer_v2.1/layer/layer.js"></script>
<script type="text/javascript">
    function openlayer(id) {
        layer.open({
            type: 2,
            title: '添加酒店信息',
            shadeClose: true,
            shade: 0.5,
            skin: 'layui-layer-rim',
            //            maxmin: true,
            closeBtn: 1,
            area: ['80%', '75%'],
            shadeClose: true,
            closeBtn: 1,
            content: 'addHotel.jsp'
            //iframe的url
        });
    }

    //    function editHotel(id) {
    //        layer.open({
    //            type: 2,
    //            title: '酒店信息',
    //            shadeClose: true,
    //            shade: 0.5,
    //            skin: 'layui-layer-rim',
    //            //            maxmin: true,
    //            closeBtn: 1,
    //            area: ['80%', '75%'],
    //            shadeClose: true,
    //            closeBtn: 1,
    //            content: 'editHotel.html'
    //            //iframe的url
    //        });
    //    }

    function deleteHotel(dom) {
        alert("删除成功");
        $(dom).parent().parent().remove();
    }

    function showHotelInfo(id) {
        layer.open({
            type: 2,
            title: '酒店信息',
            shadeClose: true,
            shade: 0.5,
            skin: 'layui-layer-rim',
            //            maxmin: true,
            closeBtn: 1,
            area: ['80%', '75%'],
            shadeClose: true,
            closeBtn: 1,
            content: 'hotelInfo.jsp'
            //iframe的url
        });
    }
</script>
</body>
</html>
